<!DOCTYPE html>
<html lang='en'>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>

<body>
    <div id="app">
        <button @click="login=true">登录</button> 
        <button @click="login=false">注册</button>
        
        <template v-if="login">
            <h1>登录界面</h1>
            <input type="text" name="user" placeholder="请输入用户名">
            <br>
            <input type="password" name="password" placeholder="请输入密码">
            <br>
            <button>登录</button>
        </template>
        <template v-else>
            <h1>注册界面</h1>
            <input type="text" name="user" placeholder="请输入用户名">
            <br>
            <input type="password" name="password" placeholder="请输入密码">
            <br>
            <input type="text" name="yanzhengma" placeholder="请输入验证码">
            <br>
            <button>注册</button>
        </template>
    </div>
    <script>
        const vm = new Vue({
            el: '#app',
            data() {
                return {
                    login:false ,
                    
                }
            },
        })
    </script>
</body>

</html>